package com.syb.filter;

import java.io.IOException;

import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Filter implements javax.servlet.Filter{

	@Override
	public void init(FilterConfig filterConfig) throws ServletException {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void doFilter(ServletRequest request, ServletResponse response,FilterChain chain) throws IOException, ServletException {
		HttpServletRequest reque = (HttpServletRequest)request;
		HttpServletResponse resp = (HttpServletResponse)response;
		System.out.print("请求地址："+reque.getRequestURI());
		/*if(reque.getSession().getAttribute("userName")==null){
			reque.getRequestDispatcher("/jsp/background/framework/login.jsp").forward(reque, resp);
		}*/
		
		
		chain.doFilter(request, response);
	}

	@Override
	public void destroy() {
		// TODO Auto-generated method stub
		
	}

}
